<template>
    <img ref="imageSrc" alt="" src="" :style="style">
</template>

<script setup>
import {inject, onMounted, reactive, ref} from "vue";

const imageSrc = ref()
const style = reactive({})
const node = ref()
const getNode = inject('getNode')

const initData = () => {
    const { src,width,height } = node.value.getData()
    imageSrc.value.src = src
    style.width = `${width}px`
    style.height = `${height}px`
}
onMounted(()=>{
    node.value = getNode()
    console.log("ImageNode",node)
    initData()
})
</script>

<style scoped>

</style>